/*
 * Serialization.h
 *
 */

#ifndef SERIALIZATION_H_
#define SERIALIZATION_H_

#include "ISerialization.h"

typedef std::vector<String> StrVector;

class Serializer : public ISerializer {
	private:
		BigInt offset;
		Binary& data;

	public:
		Serializer(Binary& data);
		virtual ~Serializer();

		void setOffset(BigInt value);
		BigInt getOffset() const;
		void setOffset(int offset);
		void move(BigInt pos);
		void serializeString(const String& value);
		void serializeUnsignedLongInt(BigInt value);
		void serializeChar(char value);
};

class Unserializer : public IUnserializer {
	private:
		BigInt offset;
		const Binary& data;

	public:
		Unserializer(const Binary& data);
		virtual ~Unserializer();

		void setOffset(BigInt value);
		BigInt getOffset() const;
		void setOffset(int offset);
		void move(BigInt pos);
		BigInt unserializeUnsignedLongInt();
		String unserializeString();
		char unserializeChar();
};

#endif  /* SERIALIZATION_H_ */
